package com.ruoyi.gzmx_tag_history.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gzmx_tag_history.mapper.Gzmx_tag_historyMapper;
import com.ruoyi.gzmx_tag_history.domain.Gzmx_tag_history;
import com.ruoyi.gzmx_tag_history.service.IGzmx_tag_historyService;
import com.ruoyi.common.core.text.Convert;

/**
 * 采集数据历史数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-02
 */
@Service
public class Gzmx_tag_historyServiceImpl implements IGzmx_tag_historyService 
{
    @Autowired
    private Gzmx_tag_historyMapper gzmx_tag_historyMapper;

    /**
     * 查询采集数据历史数据
     * 
     * @param id 采集数据历史数据主键
     * @return 采集数据历史数据
     */
    @Override
    public Gzmx_tag_history selectGzmx_tag_historyById(Long id)
    {
        return gzmx_tag_historyMapper.selectGzmx_tag_historyById(id);
    }

    /**
     * 查询采集数据历史数据列表
     * 
     * @param gzmx_tag_history 采集数据历史数据
     * @return 采集数据历史数据
     */
    @DataScope(deptAlias = "d")
    @Override
    public List<Gzmx_tag_history> selectGzmx_tag_historyList(Gzmx_tag_history gzmx_tag_history)
    {
        return gzmx_tag_historyMapper.selectGzmx_tag_historyList(gzmx_tag_history);
    }

    /**
     * 新增采集数据历史数据
     * 
     * @param gzmx_tag_history 采集数据历史数据
     * @return 结果
     */
    @Override
    public int insertGzmx_tag_history(Gzmx_tag_history gzmx_tag_history)
    {
        gzmx_tag_history.setCreateTime(DateUtils.getNowDate());
        return gzmx_tag_historyMapper.insertGzmx_tag_history(gzmx_tag_history);
    }

    /**
     * 修改采集数据历史数据
     * 
     * @param gzmx_tag_history 采集数据历史数据
     * @return 结果
     */
    @Override
    public int updateGzmx_tag_history(Gzmx_tag_history gzmx_tag_history)
    {
        gzmx_tag_history.setUpdateTime(DateUtils.getNowDate());
        return gzmx_tag_historyMapper.updateGzmx_tag_history(gzmx_tag_history);
    }

    /**
     * 批量删除采集数据历史数据
     * 
     * @param ids 需要删除的采集数据历史数据主键
     * @return 结果
     */
    @Override
    public int deleteGzmx_tag_historyByIds(String ids)
    {
        return gzmx_tag_historyMapper.deleteGzmx_tag_historyByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除采集数据历史数据信息
     * 
     * @param id 采集数据历史数据主键
     * @return 结果
     */
    @Override
    public int deleteGzmx_tag_historyById(Long id)
    {
        return gzmx_tag_historyMapper.deleteGzmx_tag_historyById(id);
    }

    @Override
    public List<Gzmx_tag_history> selectGzmx_tagListHistoryBySceneId(Long sceneId, String beginTime, String endTime) {
        return gzmx_tag_historyMapper.selectGzmx_tagListHistoryBySceneId(sceneId, beginTime, endTime);
    }
}
